package br.com.webhomesites.locacao.presenter;

import br.com.webhomesites.locacao.contracts.IDevolucaoTotComPagView;
import br.com.webhomesites.locacao.view.DevolucaoParcSemPagView;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class DevolucaoParcSemPagPresenterActionListeners {

    static class ConfirmarActionListener implements ActionListener {

        private DevolucaoParcSemPagPresenter presenter;

        public ConfirmarActionListener(DevolucaoParcSemPagPresenter presenter) {
            this.presenter = presenter;
        }

        @Override
        public void actionPerformed(ActionEvent evt) {
            presenter.setOperacao(presenter.CONFIRMAR_STRATEGY);
            presenter.getOperacao().execute();
            presenter.habilitarEdicao(true);

            DevolucaoParcSemPagView view = (DevolucaoParcSemPagView) presenter.getView();

            view.enableBtnConfirmar(false);
            view.enableBtnRecibo(true);
            view.enableBtnCancelar(false);

        }
    }

    static class CancelarActionListener implements ActionListener {

        private DevolucaoParcSemPagPresenter presenter;

        public CancelarActionListener(DevolucaoParcSemPagPresenter presenter) {
            this.presenter = presenter;
        }

        @Override
        public void actionPerformed(ActionEvent evt) {
            presenter.setOperacao(presenter.CONFIRMAR_STRATEGY);
            presenter.habilitarEdicao(true);

            IDevolucaoTotComPagView view = (IDevolucaoTotComPagView) presenter.getView();

        }
    }

    static class ReciboActionListener implements ActionListener {

        private DevolucaoParcSemPagPresenter presenter;

        public ReciboActionListener(DevolucaoParcSemPagPresenter presenter) {
            this.presenter = presenter;
        }

        @Override
        public void actionPerformed(ActionEvent evt) {
            presenter.setOperacao(presenter.CONFIRMAR_STRATEGY);
            presenter.habilitarEdicao(true);

            IDevolucaoTotComPagView view = (IDevolucaoTotComPagView) presenter.getView();

        }
    }

    
}
